import { createI18n } from 'vue-i18n'

//语言判断
let lang = 'zh'
let l = navigator.appName == 'Netscape' ? navigator.language : navigator.browserLanguage
if (l.indexOf('zh') > -1) {
  lang = 'zh'
} else {
  lang = 'en'
}
lang = localStorage.getItem('lang') || lang

const i18n = createI18n({
  locale: lang,
  fallbackLocale: 'zh',
  messages: {
    zh: require('./zh.js'),
    en: require('./en.js')
  }
})

export default i18n